<template>
	<view>
		<web-view v-if="videoUrl==''" :src="pdfUrl"></web-view>
		<view class="video-box">
			<video autoplay loop  class="video" v-if="pdfUrl==''" :src="videoUrl" controls></video>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pdfUrl:'',
				from:'',
				videoUrl:""
			}
		},
		onLoad(option) {
			var item = JSON.parse(decodeURIComponent(option.item))
			if(item.filePostfix == 'pdf' || item.filePostfix == "PDF"){
				this.pdfUrl = '/hybrid/html/web/viewer.html?file='+encodeURIComponent(item.file)
			}else{
				this.videoUrl = item.file;
			}
		},
		methods: {

		}
	}
</script>

<style>
	.video-box{
	}
	.video{
		width: 100%;
	}
</style>
